package com.qf.smartplatform.utils;/*
*王浩政 
*whz
2022/9/14
21:30
*小米商城
*/

import com.qf.smartplatform.pojo.SysUserInfo;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class SecurityUtils {
    //获取当前登陆的用户
    public static SysUserInfo getLoginUser(){
        Object user = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getSession().getAttribute("user");
        return (SysUserInfo) user;
    }
}
